package cn.wolfcode.crm.web.controller;

import cn.wolfcode.crm.query.SaleChartQueryObject;
import cn.wolfcode.crm.serivce.IChartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;
import java.util.Map;

@Controller
@RequestMapping("chart")
public class ChartController {

    @Autowired
    private IChartService chartService;

    @RequestMapping("query")
    @ResponseBody
    public List<Map<String, Object>> query(SaleChartQueryObject qo){
        List<Map<String, Object>> maps = chartService.querySale(qo);
        return maps;
    }

    @RequestMapping("view")
    public String view(){
        return "chart";
    }

}
